import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

//1.引入Element-Plus组件库与其样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//2.引入Element-Plus图标库，并起别名为ElementPlusIconsVue
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)/*创建Vue对象，并起名为app*/
//3.将引入的图标库中的所有图标组件全局注册为Vue的组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
//5.1修改elementPlus默认中文
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
//4.为前vue实例应用element-plus组件库
//5.2 app.use(ElementPlus,{ locale: zhCn })将El本地化为中文
app.use(ElementPlus,{ locale: zhCn }).use(store).use(router).mount('#app')